package com.ribbon;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;

@Configuration
public class MySelfRule {

	@Bean
	public IRule myRule() {
		// 规则定义为随机 （默认规则为轮询）
		return new RandomRule();
	}
	
	/**
	 * 手写轮询算法
	 */
	public void handRound() {
		
	}
	
}
